<template>
  <div style="padding: 8px 20px 20px 20px">
    <el-row :gutter="20">
      <el-col :span="4">
        <div style="font-size: 20px;font-weight: bold;margin: 8px 0 20px 0;"> 销售漏斗</div>
      </el-col>
    </el-row>
    <crm-funnel
      :funnel-data="funnelData"
      :title="'销售漏斗'"
    >
      <template slot="table">
        <el-table :data="tableData" style="width: 100%" max-height="400px">
          <el-table-column align="center" show-overflow-tooltip prop="employeeName" label="阶段" min-width="155"/>
          <el-table-column align="center" show-overflow-tooltip prop="followUpNum" label="金额" min-width="115"
          />
          <el-table-column align="center" show-overflow-tooltip prop="followUpCustomerNum" label="商机数"
                           min-width="115"
          />
        </el-table>
      </template>
    </crm-funnel>
  </div>
</template>

<script>
import CrmFunnel from '@/components/Echarts/Funnel/Index'

export default {
  name: 'BusinessFunnel',
  components: { CrmFunnel },
  props: {},
  data() {
    return {
      tableData: [],
      funnelData: [
        { value: 10, name: 'Visit' },
        { value: 20, name: 'Inquiry' },
        { value: 888, name: 'Order' },
        { value: 30, name: 'Click' },
        { value: 40, name: 'Show' }
      ]
    }
  },
  // 在实例创建完成后被立即调用
  created() {
    this.initData()
  },
  // 实例被挂在后调用
  mounted() {

  },
  // 方法
  methods: {
    initData() {
      for (let i = 0; i < 5; i++) {
        this.funnelData[i].value = Math.round(Math.random() * 100)
      }
    }
  }
}
</script>

<style scoped>

</style>
